package com.centaline.androidsalesblog.api.usercenter;

import com.android.volley.Request;
import com.centaline.androidsalesblog.api.UserCenterApi;
import com.centaline.androidsalesblog.constants.AppConstant;
import com.centaline.androidsalesblog.model.responseobject.SimpleUserCenterRo;
import com.centanet.framework.interfaces.IResponseListener;

/**
 * 添加收藏(为获取到collectId)
 * Created by guilin on 16/3/21.
 */
public class AddCollectApi extends UserCenterApi<SimpleUserCenterRo> {

    private String collectValue;
    private String collectUrl;

    public AddCollectApi(Class<?> tag, Class<SimpleUserCenterRo> aClass, IResponseListener<SimpleUserCenterRo> iResponseListener) {
        super(tag, aClass, iResponseListener);
    }

    public void setCollectValue(String collectValue) {
        this.collectValue = collectValue;
    }

    public void setCollectUrl(String collectUrl) {
        this.collectUrl = collectUrl;
    }

    @Override
    protected int getMethod() {
        return Request.Method.POST;
    }

    @Override
    protected void setParams() {
        putParams("UserId", AppConstant.UserId);
        putParams("CityCode", AppConstant.CityCode);
        putParams("CollectValue", collectValue);
        putParams("appName", appNameType.getAppName());
        putParams("source", sourceType.getSource());
        putParams("collectUrl", collectUrl);
    }

    @Override
    protected String getPath() {
        return "InsertCollectInfoRequest";
    }
}
